/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package term_project;

/**
 *
 * @author wrm5068
 */
public class Message 
{
    protected User sender;               // Holds the id of the message
    protected String message;       // Holds the actual message
    protected User recipient;        // The chat where the message belongs
    public Message(User send, User recip, String Message)
    {
        sender = send;
        recipient = recip;
        message = Message;
    }
    
    public String getSender()
    {
        return sender.getUsername();
    }
    public User getUserSender()
    {
        return sender;
    }
    
    public String getMessage()
    {
        return message;
    }
    
    @Override
    public String toString()
    {
        return String.format("%s: %s", sender.getUsername(), message);
    }
    
}
